package com.winenine999.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CSyauthorityMapper;
import com.winenine999.generator.dao.SyauthorityMapper;
import com.winenine999.model.Syauthority;
import com.winenine999.service.ISyauthorityService;
@Service
public class SyauthorityService implements ISyauthorityService {
	@Autowired
	private SyauthorityMapper syauthorityMapper;
	@Autowired
	private CSyauthorityMapper cSyauthorityMapper;
	/**
	 * 根据id删除syauthority
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return syauthorityMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入syauthority
	 */
	@Override
	public int insertSelective(Syauthority syauthority) {
		
		return syauthorityMapper.insertSelective(syauthority);
	}
	/**
	 * 根据id查询syauthority
	 */
	@Override
	public Syauthority selectByPrimaryKey(Integer id) {
		
		return syauthorityMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改syauthority
	 */
	@Override
	public int updateByPrimaryKeySelective(Syauthority syauthority) {
		
		return syauthorityMapper.updateByPrimaryKeySelective(syauthority);
	}
	//-----------------------------custom------------------------------
	/**
	 * 全查syauthoritys
	 */
	@Override
	public List<Map<String, Object>> findAllSyauthoritys() {
		
		return cSyauthorityMapper.findAllSyauthoritys();
	}
	/**
	 * 查询用户所具有的菜单权限
	 */
	@Override
	public List<Map<String, Object>> findPermissionsByUserId(Integer userId) {
		
		return cSyauthorityMapper.findPermissionsByUserId(userId);
	}

}
